//
//  ServiceProvider.m
//  TopShelf
//
//  Created by 刘继丹 on 17/4/20.
//  Copyright © 2017年 Stefan Arn. All rights reserved.
//

#import "ServiceProvider.h"

@interface ServiceProvider ()

@end

@implementation ServiceProvider

- (instancetype)init {
    self = [super init];
    if (self) {
    }
    return self;
}

#pragma mark - TVTopShelfProvider protocol

- (TVTopShelfContentStyle)topShelfStyle {
    return TVTopShelfContentStyleSectioned;
}

- (NSArray *)topShelfItems {
    NSMutableArray *Items = [NSMutableArray array];
    
    TVContentIdentifier *identifier = [[TVContentIdentifier alloc]initWithIdentifier:@"identifier1" container:nil];
    TVContentItem *Item = [[TVContentItem alloc]initWithContentIdentifier:identifier];
    
    for (int i = 1; i < 6; i++) {
        
        TVContentIdentifier *contentIdentifier = [[TVContentIdentifier alloc]initWithIdentifier:@"identifier2" container:identifier];
        TVContentItem *contentItem = [[TVContentItem alloc]initWithContentIdentifier:contentIdentifier];
        NSString *imageStr = [NSString stringWithFormat:@"http://ofacwexo5.bkt.clouddn.com/top%d.png",i];
        contentItem.imageURL = [NSURL URLWithString:imageStr];
        contentItem.imageShape = TVContentItemImageShapeHDTV;
        contentItem.displayURL = [NSURL URLWithString:[NSString stringWithFormat:@"hehe://\%d", i]];
        contentItem.playURL = [NSURL URLWithString:[NSString stringWithFormat:@"hehe://\%d", i]];
        [Items addObject:contentItem];
        
    }
    //    Item.title = @"热门案例";
    Item.topShelfItems = Items;
    
    return @[Item];
    
}

@end
